Field of the Invention
The present invention relates to an image capturing apparatus which uses an image sensor having a pupil-dividing function and, more particularly, to a technique of satisfactorily correcting shading.
Description of the Related Art
There are conventionally proposed an image capturing apparatus for pupil-dividing one imaging optical system using a relay lens, and performing exposure using two image sensors, and a method of obtaining pupil-divided images by dividing a photoelectric conversion portion below a microlens into a plurality of portions. These apparatus and method can be used to, for example, obtain a stereo image using the parallaxes of a plurality of obtained images, perform automatic focus detection using a phase difference detection method, and create a distance image.
To obtain a distance image or perform focus detection, it is necessary to know how much two images shift in a pupil-divided direction, and thus a correlation operation such as SAD or SSD is performed. In a correlation operation, since the shift amount between images having a high degree of matching is searched for, if the degree of matching of the images with a correct shift amount is low, it is difficult to detect a correct shift amount. A factor which decreases the degree of matching of the images can be a difference in shading. It is, therefore, desired to satisfactorily correct shading.
For example, Japanese Patent No. 2715958 discloses a technique of estimating a shading level by detecting a level difference between an A image and a B image based on an image shift amount obtained by a correlation operation, and calculating a shading correction coefficient, thereby performing shading correction. Japanese Patent No. 4265029 discloses a technique of obtaining exit pupil information from an interchangeable lens, and calculating a shading correction coefficient.
In the above-described technique disclosed in Japanese Patent No. 2715958, however, since a correlation operation is performed in advance, if a wrong image shift amount is detected by the first correlation operation, a shading correction amount is largely wrong. Even though the correlation operation is wrong, its reliability improves.
Furthermore, in the above-described technique disclosed in Japanese Patent No. 4265029, since it is necessary to perform geometric calculation, the calculation amount is large, and it takes too long to perform calculation.